<template>
  <div>当前数: {{ name }}</div>
  <button @click="update">修改名字</button>

  <div>当前年龄: {{ age }}</div>
  <button @click="addAge">修改年龄</button>
</template>

<script setup>
const name = defineModel('nameModel')
const age = defineModel('ageModel')

function update() {
  name.value = '张三'
}
function addAge() {
  age.value++
}
</script>

<style lang="scss" scoped></style>
